package Thread;

public class Dome1 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()-> {
            for (int i = 0; i < 10; i++) {
                System.out.println("hello thread");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("thead结束");
        });
        t.start();
        //main线程等待...
        t.join();
        for (int i = 0; i < 10; i++) {
            System.out.println("hello main");
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("main结束");

    }
}
